open Fr

type delta = int
type input
type output
type handle

type info = {
	name: string;
}

(* null input / output for safe fallback for defaults
   and also (theoretically) for ALSA *)
(*val null_input: input
val null_output: output*)
val default_input: input behavior
val default_output: output behavior
val inputs: input list behavior
val outputs: output list behavior
val input_info: input -> info
val output_info: output -> info

val input: input behavior -> (delta * Midi.message) list event
val connect_output:
	?latency: int ->
	output behavior -> (delta * Midi.message) list event -> handle
val disconnect_output: handle -> unit

val merge_m: 'a list event list -> 'a list event
val map_m: ('a -> 'b) -> ('c * 'a) list event -> ('c * 'b) list event
val concat_map_m: ('a -> 'b list) -> ('c * 'a) list event -> ('c * 'b) list event
